# -*- coding:UTF-8 -*-
from random import randint

l = [randint(0, 100) for x in range(10)] 
print l

def quicksort(l, left, right):
    if left > right:
        return
    i = left
    j = right
    flag = l[left]
    while i < j:
        while i < j and flag <= l[j]:
            j = j - 1
        l[i] = l[j]
        while i < j and l[i] <= flag:
            i = i + 1
        l[j] = l[i]
    l[i] = flag 
    quicksort(l, left, i - 1) 
    quicksort(l, i + 1, right)
    return l

print quicksort(l, 0, len(l) - 1)
